<template>
    <div class="person">
      <h2>当前求和：{{ sum }}</h2>
      <button @click="add">点我加1</button>
      <hr>
      <img v-for="(dog,index) in dogList" :src="dog" :key="index">
      <hr>   
      <button @click="getDog">获取一只小狗</button>
    </div>
</template>



<script lang="ts" setup name="Person">
    import useDog from '@/tooks/useDog';
    import useSum from '@/tooks/useSum';

    const {sum,add} =useSum()
    const {dogList,getDog}=useDog() 

</script>






<style scoped>
    .person {
        background-color: aqua;
        box-shadow: 0 0 10px;
        border-radius: 10px;
        padding: 20px;
    }
    button {
        margin: 0 5px;
    }
    img{
        width: 100px;
        margin: 5px;
    }
</style>